Skip to content

[NO FEATURE FLAG] feat: migrate assets domain to use the AssetsController - #78

Closed
ulissesferreira wants to merge 17 commits into
mainfrom
ASSETS-2-non-feature-flagged
Closed

[NO FEATURE FLAG] feat: migrate assets domain to use the AssetsController#78
ulissesferreira wants to merge 17 commits into
mainfrom
ASSETS-2-non-feature-flagged

Conversation

@ulissesferreira

Copy link
Copy Markdown
Contributor

Summary

  • Adds Core messenger types and endowment so the Tron snap can call AssetsController actions from MetaMask Core.
  • Routes fungible asset reads through AssetsController unconditionally (no feature flag), using SNAP_OWNED_ASSETS and mapControllerAsset to map controller state into snap-owned assets.
  • Simplifies AssetsService and tests by removing the migration-mode / feature-flag branching path.

Test plan

  • yarn workspace @metamask/tron-wallet-snap build
  • yarn workspace @metamask/tron-wallet-snap run test
  • Verify fungible assets resolve via AssetsController in all environments

Made with Cursor

ulissesferreira and others added 8 commits July 31, 2026 00:55
Co-authored-by: Cursor <cursoragent@cursor.com>
Co-authored-by: Cursor <cursoragent@cursor.com>
Co-authored-by: Cursor <cursoragent@cursor.com>
Co-authored-by: Cursor <cursoragent@cursor.com>
Co-authored-by: Cursor <cursoragent@cursor.com>
Co-authored-by: Cursor <cursoragent@cursor.com>
Co-authored-by: Cursor <cursoragent@cursor.com>
Derived from ASSETS-2-feature-flagged. Strips the remote-feature-flag and TRON_ASSETS_MIGRATION_STAGE env surface. Fungibles always read via AssetsController:getAsset. Protocol assets remain Snap-owned via isSnapOwnedAsset. Removed: assetsMigrationMode.ts, its test, and RemoteFeatureFlagController:getState messenger action.
@ulissesferreira
ulissesferreira requested review from a team as code owners July 31, 2026 00:17
@ulissesferreira

Copy link
Copy Markdown
Contributor Author

@cursoragent Do the following

  • Move each set of handlers into their own folders for better readability assets, cronjob, keyring, user-input
  • Rename the AssetsService main functions that are used throughout the code to be getAccountAssetByID, getAccountAssetsByIDs, getAccountAssets

@cursor

cursor Bot commented Jul 31, 2026

Copy link
Copy Markdown

I applied both review requests on ASSETS-2-non-feature-flagged and pushed to #78.

Handler folders

  • handlers/assets/
  • handlers/cronjob/
  • handlers/keyring/ (includes keyring-types)
  • handlers/user-input/

AssetsService renames

  • getAssetByAccountIdgetAccountAssetByID
  • getAssetsByAccountIdgetAccountAssetsByIDs
  • getAllAssetsByAccountIdgetAccountAssets

Imports/usages and changelog were updated. Full package suite: 895 tests passed.

Open in Web Open in Cursor 

Move assets, cronjob, keyring, and user-input handlers into dedicated
folders, and rename AssetsService account asset readers to
getAccountAssetByID, getAccountAssetsByIDs, and getAccountAssets.

Co-authored-by: Ulisses Ferreira <ulisses@hey.com>
@ulissesferreira ulissesferreira changed the title feat: ASSETS-2 — always-on AssetsController for fungibles [NO FEATURE FLAG] feat: migrate assets domain to use the AssetsController as much as possible Jul 31, 2026
@ulissesferreira ulissesferreira changed the title [NO FEATURE FLAG] feat: migrate assets domain to use the AssetsController as much as possible [NO FEATURE FLAG] feat: migrate assets domain to use the AssetsController Jul 31, 2026
@ulissesferreira
ulissesferreira marked this pull request as draft July 31, 2026 10:32
Expose instant fungible asset listing via AssetsController so snap flows
can read controller-backed balances by network without on-chain sync.
@ulissesferreira

Copy link
Copy Markdown
Contributor Author

Superseded by the WPN-1497 chain (#90#91#92#95#96), which ends in two optional tails (direct core vs feature-flagged core). Closing per discussion.

jeremytsng pushed a commit that referenced this pull request Aug 5, 2026
## Explanation

Adds transaction expiration (time-bounds maxTime) handling to prevent
simulation/validation of expired Stellar envelopes, wiring the logic
through the Transaction wrapper and TransactionSimulator, and covering
it with tests.

<!--
Thanks for your contribution! Take a moment to answer these questions so
that reviewers have the information they need to properly understand
your changes:

* What is the current state of things and why does it need to change?
* What is the solution your changes offer and how does it work?
* Are there any changes whose purpose might not obvious to those
unfamiliar with the domain?
* If your primary goal was to update one package but you found you had
to update another one along the way, why did you do so?
* If you had to upgrade a dependency, why did you do so?
-->

## References

<!--
Are there any issues that this pull request is tied to?
Are there other links that reviewers should consult to understand these
changes better?
Are there client or consumer pull requests to adopt any breaking
changes?

For example:

* Fixes #12345
* Related to #67890
-->

## Checklist

- [ ] I've updated the test suite for new or updated code as appropriate
- [ ] I've updated documentation (JSDoc, Markdown, etc.) for new or
updated code as appropriate
- [ ] I've communicated my changes to consumers by [updating changelogs
for packages I've
changed](https://github.com/MetaMask/core/tree/main/docs/processes/updating-changelogs.md)
- [ ] I've introduced [breaking
changes](https://github.com/MetaMask/core/tree/main/docs/processes/breaking-changes.md)
in this PR and have prepared draft pull requests for clients and
consumer packages to resolve them
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants